package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.KnowledgeMapMapper;
import com.ruoyi.business.domain.KnowledgeMap;
import com.ruoyi.business.service.IKnowledgeMapService;

/**
 * 知识地图Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-21
 */
@Service
public class KnowledgeMapServiceImpl  extends BaseServiceImpl implements IKnowledgeMapService
{
    @Autowired
    private KnowledgeMapMapper knowledgeMapMapper;

    /**
     * 查询知识地图
     * 
     * @param id 知识地图主键
     * @return 知识地图
     */
    @Override
    public KnowledgeMap selectKnowledgeMapById(Long id)
    {
        return knowledgeMapMapper.selectKnowledgeMapById(id);
    }

    /**
     * 查询知识地图列表
     * 
     * @param knowledgeMap 知识地图
     * @return 知识地图
     */
    @Override
    public List<KnowledgeMap> selectKnowledgeMapList(KnowledgeMap knowledgeMap)
    {
        return knowledgeMapMapper.selectKnowledgeMapList(knowledgeMap);
    }

    /**
     * 新增知识地图
     * 
     * @param knowledgeMap 知识地图
     * @return 结果
     */
    @Override
    public int insertKnowledgeMap(KnowledgeMap knowledgeMap)
    {
        knowledgeMap.setCreateTime(DateUtils.getNowDate());
        return knowledgeMapMapper.insertKnowledgeMap(knowledgeMap);
    }

    /**
     * 修改知识地图
     * 
     * @param knowledgeMap 知识地图
     * @return 结果
     */
    @Override
    public int updateKnowledgeMap(KnowledgeMap knowledgeMap)
    {
        knowledgeMap.setUpdateTime(DateUtils.getNowDate());
        return knowledgeMapMapper.updateKnowledgeMap(knowledgeMap);
    }

    /**
     * 批量删除知识地图
     * 
     * @param ids 需要删除的知识地图主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeMapByIds(Long[] ids)
    {
        return knowledgeMapMapper.deleteKnowledgeMapByIds(ids);
    }

    /**
     * 删除知识地图信息
     * 
     * @param id 知识地图主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeMapById(Long id)
    {
        return knowledgeMapMapper.deleteKnowledgeMapById(id);
    }
}
